<template>
  <div id="dome">
    <div style="height: 78px"></div>
    <Carousel autoplay  loop>
      <CarouselItem v-for="item in swiper">
        <div class="demo-carousel">
          <img :src="item.url" width="100%">
        </div>
      </CarouselItem>
    </Carousel>

    <p>{{author}}</p>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import Vue from 'vue'
  import {Carousel,CarouselItem,Input,Button} from 'iview';
  Vue.component('Carousel', Carousel);
  Vue.component('CarouselItem', CarouselItem);
  Vue.component('Input', Input);
  Vue.component('Button', Button);
  export default {
    data () {
      return {
        storeQuery: {
          cb_store_busistatus: 1,
          cb_store_custid: "1",
          cb_store_status: 1
        },
        swiper: [
          {
            url: 'http://static.runoob.com/images/mix/img_fjords_wide.jpg',
          },
          {
            url: 'http://static.runoob.com/images/mix/img_nature_wide.jpg',
          },
          {
            url: 'http://static.runoob.com/images/mix/img_mountains_wide.jpg',
          },
        ],
      }
    },
    computed: {
      author () {
        return this.$store.state.author
      }
    },
    created(){
      this.request();
    },
    methods: {
      request(){
        this.url = this.$store.state.url;
        this.$ajax.post(this.url + '/wechat/queryStore.do', this.storeQuery).then((response) => {
          if (response.data.status === "200") {
            this.tableData = response.data.tableData;
          } else if (response.data.status === "401") {
            this.tableData = response.data.tableData;
            this.$message.error(response.data.message);
          } else {
            this.$message.error('系统错误！')
          }
        });
      },
    }
  }
</script>

<style scoped>
  #dome {
    width: 100%;
    min-height: 50px;
    /*background: gray;*/
  }

  .carousel-inner img {
    width: 100%;
    height: 100%;
  }

</style>
